#include "std.h"
look(str) {
 string bb;
   if (!str) {
   return 0;
   }
    if(str=="at floor") {
       write("A beaten, worn out, old wood floor.\n");
       return 1;
     }
   if(str=="at benches" || str=="at bench") {
     write("Ordinary wood benches with green flaking paint on them.\n");
     return 1;
   }
   if(str=="at desks" || str=="at desk") {
     write("A beat up wood desk that has seen many years of use.\n");
     return 1;
   }
   if(str=="at greeting desk") {
     write("A larged elevated desk where the officer working the desk\n"+
     "would greet people entering the station house.\n");
     return 1;
   }
   if (str == "at cell" || str=="in cell") {
     call_other("room/prison","seein",0);
     return 1;
   }
   if(sscanf(str,"%s in cell",bb)==1) {
    call_other("room/prison","seein",bb);
    return 1;
   }
   if(sscanf(str,"in cell %s",bb)==1) {
    call_other("room/prison","seein",bb);
    return 1;
   }

return 0;
}

#undef EXTRA_RESET
#define EXTRA_RESET extra_reset();
#undef EXTRA_INIT
#define EXTRA_INIT extra_init();

extra_init() {
/*
   if(!present("whistle"))
       move_object(clone_object("players/boltar/things/polw.c"), this_object());
*/
     add_action("look", "look");
     add_action("look", "l");
     add_action("look", "examine");
     add_action("look", "search");
   }

seein(str) {
    object ob, ob_tmp;
    string item;
    int max;
    if(str)
    if (sscanf(str, "at %s", item) == 1 || sscanf(str, "in %s", item) ==1)
{
       item = lower_case(item);
       ob = present(item, this_object());
       if(look(str)) return 1;
       if (!ob ) {
          write("There is no " + item + " here.\n");
          return 1;
       }
       call_other(ob, "long", item);
        if (!call_other(ob, "can_put_and_get", item))
            return 1;
        if (living(ob)) {
            object special;
            special = first_inventory(ob);
            while (special) {
                string extra_str;
                extra_str = call_other(special, "extra_look");
                if (extra_str)
                    write(extra_str + ".\n");
                special = next_inventory(special);
            }
        }
        ob_tmp = first_inventory(ob);
        while (ob_tmp && call_other(ob_tmp, "short") == 0)
            ob_tmp = next_inventory(ob_tmp);
            if (ob_tmp) {
            if (living(ob))
                write("\t" + capitalize(item) + " is carrying:\n");
            else
                write("\t" + capitalize(item) + " contains:\n");
            }
            max = 20;
            ob = first_inventory(ob);
         while (ob && max > 0) {
            string sh;
            sh = call_other(ob, "short");
            if (sh)
                write(sh + ".\n");
            ob = next_inventory(ob);
            max -= 1;
        }
        return 1;
      }
    call_other(this_object(), "long");
    ob = first_inventory(this_object());
    if(ob)  write("The police station contains:\n");
    if(!ob) write("The cell is empty.\n");
    max = 20;
    while(ob && max > 0) {
         string short_str;
         short_str = call_other(ob, "short");
         if (short_str) {
             max -= 1;
             write(short_str + ".\n");
             item = short_str;
         }
         ob = next_inventory(ob);
    }
    return 1;
}

extra_reset()
{
    int n,i,tt;
    object cop;
    i = 0;
   if(!present("ct")) move_object(clone_object("players/boltar/things/ct"),this_object());
    if (!present("cop")) {
   tt = 6;
	while(i<tt) {
	    i += 1;
    cop = clone_object("players/boltar/things/cop.c");
  if (i == 1)
    move_object(cop, this_object());
  if (i == 2)
      move_object(cop, "room/shop.c");
  if (i == 3)
      move_object(cop, "room/pub2");
    if(i > 3)
         move_object(cop, "room/vill_road3");
    }
}
}
TWO_EXIT("room/verte/bounty_office", "north",
   "room/southroad1", "east",
	 "The police station",
"This is the town police station. It consists of a single large room\n"+
"with benches, desks and other seating locations. One may find the \n"+
"village peace keepers here or prisoners locked up in the small bared\n"+
"cell to the west. The station looks quite old as if it has been in\n"+
"service for a century or more. The floor is worn as well as the\n"+
"greeting desk. Everything is kept clean and tidy despite the worn\n"+
"conditions. To the north is the village bounty office.\n",1)
